<template lang="html">
  <el-dialog
    width="1000px"  
    :title="`数据详情`"
    :close-on-click-modal="false"
    :visible="dialogVisible"
    destroy-on-close
    @close="close"
  >  
   <el-table
        ref="multipleTable"
        border
        stripe
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
      >
        <el-table-column type="index" width="50" label="序号" align="center" />
        <el-table-column  v-for="(item, index) in cloumns" :key="item.name"  :prop="item.name" :label="item.name" align="center" show-overflow-tooltip /> 
      </el-table> 
      
    <footer-page
      slot="footer"
      :pageSize="pageSize"
      :currentPage="currentPage"
      :total="total"
      @handleSizeChange="handleSizeChange"
      @handleCurrentChange="handleCurrentChange"
    /> 
 </el-dialog>
</template>

<script>
import { DataPageList} from "api/dtmg/tasklog";
import dialogMixin from "mixins/dialogMixin"; 
import tableMixinKeepAlive from "mixins/tableMixinKeepAlive";

export default {
  components: { },
  mixins: [dialogMixin,tableMixinKeepAlive],
  props: {
    // 当前行数据
    logId: {
      type: [String, Number],
      default: "",
    }, 
  },
  data() {
    return {
       // 接口api
      getTableListSyncMethod: DataPageList, 
      loadDataDirectory: false,
      cloumns:[]
    };
  },

  methods: {
      /**
     * 初始化弹窗
     */
     initForm() { 
       this.getTableData();
    },
    searchObjFormat() { 
      return {logId:this.logId};
    },
       /**
     * 列表数据格式化
     */
     tableDataFormat(data) { 
         Object.entries(data[0]).forEach( label=>{
			          let [_key , _value] = label;
                this.cloumns.push({name:_key});
		       }); 
   
      return data;
    }, 
  },
};
</script>
